# 使用tiangolo/uvicorn-gunicorn:python3.10-slim镜像作为基础镜像
FROM registry.cn-shanghai.aliyuncs.com/seven_888/uvicorn-python-arm:3.10-slim

ENV LANG zh_cn.UTF-8
# 设置时区
ENV TZ=Asia/Shanghai

# 设置工作目录
WORKDIR /app

# 将当前目录下的文件复制到工作目录
COPY . /app

ENV LD_LIBRARY_PATH=/app/dpi

# 安装FastAPI和依赖
RUN pip install ./whl/dmPython-2.5.8-cp310-cp310-linux_aarch64.whl
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/

# 暴露端口
EXPOSE 9100

# 运行FastAPI应用
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "9100", "--reload", "--workers", "10", "--log-level", "info"]